package com.dc.common.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Data
public class BaseModel<T> implements Serializable {
    /**
     * 用于方法返回页面时
     */
    @ApiModelProperty(value = "返回编号值正确消息是0;未登录9，无权限8，重复提交7；负的值都是有数据有问题")
    private int code = 0;

    @ApiModelProperty(value = "存放返回的消息")
    private String message = "";

    @ApiModelProperty(value = "错误的异常信息")
    private String messageEX = "";

    @ApiModelProperty(value = "存放查询结果集")
    private T data = null;

    @ApiModelProperty(value = "防表单重复提交token")
    private String token = "";

    /**
     * 用于切面返回方法时
     */
    @ApiModelProperty(value = "切面消息")
    private String aopMsg = "";

    @ApiModelProperty(value = "数据处理前")
    private String dataBefore = "";

    @ApiModelProperty(value = "数据处理后")
    private String dataAfter = "";

    /**
     * 用于传入时
     */
    @ApiModelProperty(value = "用于多条删除时存放ids")
    private String ids = "";

    @ApiModelProperty(value = "页码")
    private int page;

    @ApiModelProperty(value = "行数")
    private int rows;

    @ApiModelProperty(value = "关键字")
    private String key;

    @ApiModelProperty(value = "用于文件导入时存放文件")
    private MultipartFile[] tempMFile = null;// 用于文件导入时存放文件

//    @ApiModelProperty(value = "用于存放查询权限map")
//    private Map<String, Object> searchRoleMap = new HashMap<>();

//    @ApiModelProperty(value = "用户访问的ip地址")
//    private String requestIp;
//
//    @ApiModelProperty(value = "请求时的服务器时间")
//    private Date currentTime = new Date();


}
